package com.fmdj.customer.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.fmdj.common.util.CommonResult;
import com.fmdj.customer.service.OrderPositionService;
import com.fmdj.mps.controller.form.SearchOrderLocationCacheForm;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.HashMap;

@RestController
@RequestMapping("/order/location")
@Tag(name = "OrderPositionController", description = "订单定位模块Web接口")
public class OrderPositionController {

    @Autowired
    private OrderPositionService orderPositionService;

    @PostMapping("/searchOrderLocationCache")
    @Operation(summary = "查询订单定位缓存")
    @SaCheckLogin
    public CommonResult searchOrderPositionCache(@Valid @RequestBody SearchOrderLocationCacheForm form) {
        HashMap hashMap = orderPositionService.searchOrderPositionCache(form);
        return CommonResult.ok().put(CommonResult.RETURN_RESULT, hashMap);
    }
}
